<?php

class LoginController extends Controller {
	public $DB;
	public function __Init(){
		$this->DB = new AdminModel;
	}
	public function Login(){
		if(ISPOST){
			if($this->DB->userLogin($_POST)){
				$this->success('登录成功',__MODEL__);
			}else{
				$this->error($this->DB->error);
			}
		}else{
			$this->display('login.html');
		}
	}

	public function out(){
		session_unset();
		session_destroy();
		$this->success('已安全退出',__CONTROLLER__.'&a=login');
	}
}


?>